<?php

namespace app\api\model;

use think\Model;

class Banner extends Model
{
    protected $hidden = ["weigh", "online", "createtime", "updatetime"];

    public function getImageAttr($value)
    {
        return $value ? request()->domain().$value : '';
    }

    public static function getBanners()
    {
        return self::where("online", "yes")->order("weigh desc")->select();
    }
}
